using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using ChinaDynastyTours.Controls;
using System.Data;

namespace ChinaDynastyTours.Assets
{
    public partial class HotelOrderReport : DevExpress.XtraReports.UI.XtraReport
    {
        public HotelOrderReport(string tourgroupId, string roomRemark, string hotelNames)
        {
            InitializeComponent();

            DataTable tourgroupRowDt = TeamGroupCtrl.GetTeamGroupRowDataforHotelorder(tourgroupId);
            DataTable hotelRoomDt = HotelOrderCtrl.GetHotelOrderRoomNum(tourgroupId);

            xrTableCell2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            xrTableCell13.Text = tourgroupId;
            xrTableCell9.Text = tourgroupRowDt.Rows[0]["TourgroupName"].ToString();//tourgroupName;
            xrTableCell10.Text = tourgroupRowDt.Rows[0]["GuestNum"].ToString();
            if (hotelRoomDt != null && hotelRoomDt.Rows.Count > 0)
            {
                xrTableCell14.Text = hotelRoomDt.Rows[0]["TotalRoomNum"].ToString();
                xrTableCell15.Text = hotelRoomDt.Rows[0]["DoubleRoomNum"].ToString();
                xrTableCell48.Text = hotelRoomDt.Rows[0]["SingleRoomNum"].ToString();
                xrTableCell16.Text = hotelRoomDt.Rows[0]["ThreeRoomNum"].ToString();
                xrTableCell49.Text = hotelRoomDt.Rows[0]["BigBedRoomNum"].ToString();
            }
            xrTableCell28.Text = tourgroupRowDt.Rows[0]["AccompanyNum"].ToString();
            xrTableCell36.Text = tourgroupRowDt.Rows[0]["OwnerA"].ToString();//ownerA;
            xrTableCell37.Text = tourgroupRowDt.Rows[0]["OwnerB"].ToString();//ownerB;

            DataTable UserInfoDt = UserInfoCtrl.GetTelephoneFaxByUserRealName(xrTableCell37.Text);

            if (UserInfoDt != null && UserInfoDt.Rows.Count > 0)
            {
            xrTableCell38.Text = UserInfoDt.Rows[0]["Telephone"].ToString();//telephone;
            xrTableCell39.Text = UserInfoDt.Rows[0]["Fax"].ToString();//Fax;
            }
            xrLabel1.Text = roomRemark;
            xrLabel3.Text = hotelNames;

        }
    }
}
